package top.xinsix.est.controller;

import top.xinsix.est.dto.ClassifyDto;
import top.xinsix.est.service.ClassifyService;
import top.xinsix.est.tools.Result;
import top.xinsix.est.tools.ResultUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 主页控制器
 */
@RestController
@RequestMapping("/api/home/")
public class HomeController {
    @Resource
    private ClassifyService classifyService;
    @GetMapping("/classifyTree")
    public Result classifyTree(){
        List<ClassifyDto> classifyDtoList=classifyService.getTree();
        return ResultUtils.returnDataSuccess(classifyDtoList);
    }
}
